﻿namespace WatiNSahi.Extensions
{
    using global::WatiN.Core;

    public static class HtmlDialogCollectionExtensions
    {
        public static bool Exists(this HtmlDialogCollection htmlDialogCollection, string htmlDialogIdOrNameOrValueorClass, bool extension = true)
        {
            return htmlDialogCollection.Exists(Find.ById(htmlDialogIdOrNameOrValueorClass)) ||
                htmlDialogCollection.Exists(Find.ByName(htmlDialogIdOrNameOrValueorClass)) ||
                htmlDialogCollection.Exists(Find.ByValue(htmlDialogIdOrNameOrValueorClass)) ||
                htmlDialogCollection.Exists(Find.ByClass(htmlDialogIdOrNameOrValueorClass)) ||
                htmlDialogCollection.Exists(Find.ByLabelText(htmlDialogIdOrNameOrValueorClass));
        }
    }
}